package edu.hawaii.wattdepotapps;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;

/**
 * Tests the main class that starts the Jetty server.
 * 
 * @author Robert Brewer
 */
public class TestJetty {

  /**
   * Simple tests on the connectDataSource static method.
   */
  @Test
  public void testConnectDataSource() {
    assertFalse("Able to connect to mangled URI", Jetty
        .connectDataSource("bogus://x"));
    assertFalse("Able to connect to bad hostname", Jetty
        .connectDataSource("http://bogus.example.com/"));
    assertTrue("Unable to connect to Google", Jetty
        .connectDataSource("http://www.google.com/"));
  }
}
